Inventory Functions

Also see: Generic Functions

createInventory()

Creates an empty InventoryData.
Returns the InventoryData > InventoryKey.

destroyInventory(InventoryData > InventoryKey)

Destroys the given InventoryData.

addInventory(CharacterData > CharacterKey, InventoryData > InventoryKey)

Adds the given InventoryData to the given CharacterData inventories and removes it from its previous owner.

removeInventory(CharacterData > CharacterKey, InventoryData > InventoryKey)

Removes the given InventoryData from the given CharacterDatas inventories.

removeInventoryFromOwner(InventoryData > InventoryKey)

Removes the given InventoryData from the owning CharacterDatas inventories.

getAllInventoryItems(InventoryData > InventoryKey)

Returns ItemData > ItemKeys of all items in the given InventoryData.

openInventoryWindow(Inventory InventoryData > InventoryKey, Target InventoryData > InventoryKey, Mode Type > String, Event Type > Table, Value Multiplier Type > Float, Search Enabled Type > Boolean, Display Currency Type > Boolean, Item Width Type > Float)

Opens an inventory window for item transactions.

  • Inventory: Is the inventory which ItemData will be displayed.
  • Target: Is the inventory to which ItemData are transferred. If left empty the items are "destroyed".
  • Mode: Defines the mode of transaction. Can be:
    • "default": Let's the player use and equip items.
    • "buy": Let's the player buy items in exchange of currency.
      • "Inventory" should be the vendor inventory and "Target" should be "player".
    • "copy": Same as "buy", but the item is copied instead of transferred.
    • "sell": Let's the player sell items in exchange of currency.
      • "Inventory" should be "player" and "Target" should be empty or a vendor inventory.
    • "inspect": Let's the player see the items in the inventory.
    • "event": Let's the player trigger the given event on item use.
  • Event: Defines scripts that execute at specific times.
    • "onClose": Executes when the window is closed.
  • Value Multiplier: Multiplies the value of items by the multiplier. Mainly used for buying and selling.
  • Search Enabled: When this is true a search bar is shown at the top to filter items.
  • Display Currency: When this is true the players currency is shown in the window.
  • Item Width: Sets the width of item icons.
closeInventoryWindow()

Closes all current inventory windows.